/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package verifica;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.Calendar;

/**
 *
 * @author ARROCOLH
 */
public class Verifico {
    public static Date DateNull(String dateV){
       Date result = null;
        if (dateV!=null) {

            result = Date.valueOf(dateV);

        }

    return result;
    }

    public static Timestamp TimestampNull(String stringV){
        Timestamp result = null;
        if (stringV!=null) {
            result = Timestamp.valueOf(stringV);
        }else{
        result = new Timestamp(Calendar.getInstance().getTime().getTime());
        }

    return result;
    }

    public static String IntNull(int intV){

        String result = null;

        Integer aux = new Integer(intV);

        result = aux.toString();

        return result;
    }

    public static Integer StringNull(String in){

        Integer result = null;

        if (in!=null) {
            result = Integer.parseInt(in);
        }

    return result;
    }

}
